<!DOCTYPE html>
<html lang="" xml:lang="">
<head>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>Chapter 5 Chapter 5 | Data visualisation using R, for researchers who don’t use R</title>
  <meta name="description" content="Abstract here." />
  <meta name="generator" content="bookdown 0.22 and GitBook 2.6.7" />

  <meta property="og:title" content="Chapter 5 Chapter 5 | Data visualisation using R, for researchers who don’t use R" />
  <meta property="og:type" content="book" />
  
  
  <meta property="og:description" content="Abstract here." />
  

  <meta name="twitter:card" content="summary" />
  <meta name="twitter:title" content="Chapter 5 Chapter 5 | Data visualisation using R, for researchers who don’t use R" />
  
  <meta name="twitter:description" content="Abstract here." />
  

<meta name="author" content="Emily Nordmann, Phil McAleer, Wilhelmiina Toivo, Helena Paterson, Lisa DeBruine" />


<meta name="date" content="2021-06-17" />

  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  
  
<link rel="prev" href="chapter-4.html"/>
<link rel="next" href="chapter-6.html"/>
<script src="libs/header-attrs-2.9/header-attrs.js"></script>
<script src="libs/jquery-2.2.3/jquery.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />









<link href="libs/anchor-sections-1.0.1/anchor-sections.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.0.1/anchor-sections.js"></script>
<meta property="og:title" content="IntroDataViz">
<meta property="og:description" content="Data Visualisation Using R, For Researchers Who Don’t Use R.">
<meta property="og:image" content="https://psyteachr.github.io/images/twitter/psyteachr.png">
<meta property="og:url" content="https://psyteachr.github.io/introdataviz/">
<meta property="twitter:card" content="summary_large_image">

<link rel="shortcut icon" href="https://psyteachr.github.io/images/logo.png">


<style type="text/css">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
    color: #aaaaaa;
  }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>

<style type="text/css">
/* Used with Pandoc 2.11+ new --citeproc when CSL is used */
div.csl-bib-body { }
div.csl-entry {
  clear: both;
}
.hanging div.csl-entry {
  margin-left:2em;
  text-indent:-2em;
}
div.csl-left-margin {
  min-width:2em;
  float:left;
}
div.csl-right-inline {
  margin-left:2em;
  padding-left:1em;
}
div.csl-indent {
  margin-left: 2em;
}
</style>

<link rel="stylesheet" href="include/psyteachr.css" type="text/css" />
<link rel="stylesheet" href="include/webex.css" type="text/css" />
<link rel="stylesheet" href="include/style.css" type="text/css" />
</head>

<body>



  <div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">

    <div class="book-summary">
      <nav role="navigation">

<ul class="summary">
<li><a href="./">IntroDataViz</a></li>
<li><a href="https://zenodo.org/badge/latestdoi/166559207"><img src="https://zenodo.org/badge/166559207.svg" alt="DOI"></a></li>

<li class="divider"></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>Overview</a></li>
<li class="chapter" data-level="1" data-path="introduction.html"><a href="introduction.html"><i class="fa fa-check"></i><b>1</b> Introduction</a>
<ul>
<li class="chapter" data-level="1.1" data-path="introduction.html"><a href="introduction.html#why-r-for-data-visualisation"><i class="fa fa-check"></i><b>1.1</b> Why R for data visualisation?</a></li>
<li class="chapter" data-level="1.2" data-path="introduction.html"><a href="introduction.html#a-layered-grammar-of-graphics"><i class="fa fa-check"></i><b>1.2</b> A layered grammar of graphics</a></li>
<li class="chapter" data-level="1.3" data-path="introduction.html"><a href="introduction.html#simulated-dataset"><i class="fa fa-check"></i><b>1.3</b> Simulated dataset</a></li>
<li class="chapter" data-level="1.4" data-path="introduction.html"><a href="introduction.html#setting-up-r-and-rstudio"><i class="fa fa-check"></i><b>1.4</b> Setting up R and RStudio</a></li>
<li class="chapter" data-level="1.5" data-path="introduction.html"><a href="introduction.html#preparing-your-data"><i class="fa fa-check"></i><b>1.5</b> Preparing your data</a>
<ul>
<li class="chapter" data-level="1.5.1" data-path="introduction.html"><a href="introduction.html#data-format"><i class="fa fa-check"></i><b>1.5.1</b> Data format</a></li>
<li class="chapter" data-level="1.5.2" data-path="introduction.html"><a href="introduction.html#variable-names"><i class="fa fa-check"></i><b>1.5.2</b> Variable names</a></li>
<li class="chapter" data-level="1.5.3" data-path="introduction.html"><a href="introduction.html#data-values"><i class="fa fa-check"></i><b>1.5.3</b> Data values</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="2" data-path="chapter-2.html"><a href="chapter-2.html"><i class="fa fa-check"></i><b>2</b> Chapter 2</a>
<ul>
<li class="chapter" data-level="2.1" data-path="chapter-2.html"><a href="chapter-2.html#loading-packages"><i class="fa fa-check"></i><b>2.1</b> Loading packages</a></li>
<li class="chapter" data-level="2.2" data-path="chapter-2.html"><a href="chapter-2.html#loading-data"><i class="fa fa-check"></i><b>2.2</b> Loading data</a></li>
<li class="chapter" data-level="2.3" data-path="chapter-2.html"><a href="chapter-2.html#handling-numeric-factors"><i class="fa fa-check"></i><b>2.3</b> Handling numeric factors</a></li>
<li class="chapter" data-level="2.4" data-path="chapter-2.html"><a href="chapter-2.html#argument-names"><i class="fa fa-check"></i><b>2.4</b> Argument names</a></li>
<li class="chapter" data-level="2.5" data-path="chapter-2.html"><a href="chapter-2.html#demographic-information"><i class="fa fa-check"></i><b>2.5</b> Demographic information</a></li>
<li class="chapter" data-level="2.6" data-path="chapter-2.html"><a href="chapter-2.html#bar-chart-of-counts"><i class="fa fa-check"></i><b>2.6</b> Bar chart of counts</a></li>
<li class="chapter" data-level="2.7" data-path="chapter-2.html"><a href="chapter-2.html#plotting-existing-aggregates-and-percent"><i class="fa fa-check"></i><b>2.7</b> Plotting existing aggregates and percent</a></li>
<li class="chapter" data-level="2.8" data-path="chapter-2.html"><a href="chapter-2.html#histogram"><i class="fa fa-check"></i><b>2.8</b> Histogram</a></li>
<li class="chapter" data-level="2.9" data-path="chapter-2.html"><a href="chapter-2.html#customisation-1"><i class="fa fa-check"></i><b>2.9</b> Customisation 1</a>
<ul>
<li class="chapter" data-level="2.9.1" data-path="chapter-2.html"><a href="chapter-2.html#changing-colours"><i class="fa fa-check"></i><b>2.9.1</b> Changing colours</a></li>
<li class="chapter" data-level="2.9.2" data-path="chapter-2.html"><a href="chapter-2.html#editing-axis-names-and-labels"><i class="fa fa-check"></i><b>2.9.2</b> Editing axis names and labels</a></li>
<li class="chapter" data-level="2.9.3" data-path="chapter-2.html"><a href="chapter-2.html#discrete-vs.-continuous-errors"><i class="fa fa-check"></i><b>2.9.3</b> Discrete vs. continuous errors</a></li>
<li class="chapter" data-level="2.9.4" data-path="chapter-2.html"><a href="chapter-2.html#adding-a-theme"><i class="fa fa-check"></i><b>2.9.4</b> Adding a theme</a></li>
</ul></li>
<li class="chapter" data-level="2.10" data-path="chapter-2.html"><a href="chapter-2.html#activities-1"><i class="fa fa-check"></i><b>2.10</b> Activities 1</a></li>
</ul></li>
<li class="chapter" data-level="3" data-path="chapter-3.html"><a href="chapter-3.html"><i class="fa fa-check"></i><b>3</b> Chapter 3</a>
<ul>
<li class="chapter" data-level="3.1" data-path="chapter-3.html"><a href="chapter-3.html#data-formats"><i class="fa fa-check"></i><b>3.1</b> Data formats</a></li>
<li class="chapter" data-level="3.2" data-path="chapter-3.html"><a href="chapter-3.html#transforming-data"><i class="fa fa-check"></i><b>3.2</b> Transforming data</a>
<ul>
<li class="chapter" data-level="3.2.1" data-path="chapter-3.html"><a href="chapter-3.html#step-1-pivot_longer"><i class="fa fa-check"></i><b>3.2.1</b> Step 1: <code>pivot_longer()</code></a></li>
<li class="chapter" data-level="3.2.2" data-path="chapter-3.html"><a href="chapter-3.html#step-2-pivot_longer-adjusted"><i class="fa fa-check"></i><b>3.2.2</b> Step 2: <code>pivot_longer()</code> adjusted</a></li>
<li class="chapter" data-level="3.2.3" data-path="chapter-3.html"><a href="chapter-3.html#step-3-pivot_wider"><i class="fa fa-check"></i><b>3.2.3</b> Step 3: <code>pivot_wider()</code></a></li>
</ul></li>
<li class="chapter" data-level="3.3" data-path="chapter-3.html"><a href="chapter-3.html#histogram-2"><i class="fa fa-check"></i><b>3.3</b> Histogram 2</a></li>
<li class="chapter" data-level="3.4" data-path="chapter-3.html"><a href="chapter-3.html#density-plots"><i class="fa fa-check"></i><b>3.4</b> Density plots</a>
<ul>
<li class="chapter" data-level="3.4.1" data-path="chapter-3.html"><a href="chapter-3.html#grouped-density-plots"><i class="fa fa-check"></i><b>3.4.1</b> Grouped density plots</a></li>
</ul></li>
<li class="chapter" data-level="3.5" data-path="chapter-3.html"><a href="chapter-3.html#scatterplots"><i class="fa fa-check"></i><b>3.5</b> Scatterplots</a>
<ul>
<li class="chapter" data-level="3.5.1" data-path="chapter-3.html"><a href="chapter-3.html#grouped-scatterplots"><i class="fa fa-check"></i><b>3.5.1</b> Grouped scatterplots</a></li>
</ul></li>
<li class="chapter" data-level="3.6" data-path="chapter-3.html"><a href="chapter-3.html#transforming-data-2"><i class="fa fa-check"></i><b>3.6</b> Transforming data 2</a></li>
<li class="chapter" data-level="3.7" data-path="chapter-3.html"><a href="chapter-3.html#customisation-2"><i class="fa fa-check"></i><b>3.7</b> Customisation 2</a>
<ul>
<li class="chapter" data-level="3.7.1" data-path="chapter-3.html"><a href="chapter-3.html#accessible-colour-schemes"><i class="fa fa-check"></i><b>3.7.1</b> Accessible colour schemes</a></li>
</ul></li>
<li class="chapter" data-level="3.8" data-path="chapter-3.html"><a href="chapter-3.html#activities-2"><i class="fa fa-check"></i><b>3.8</b> Activities 2</a></li>
</ul></li>
<li class="chapter" data-level="4" data-path="chapter-4.html"><a href="chapter-4.html"><i class="fa fa-check"></i><b>4</b> Chapter 4</a>
<ul>
<li class="chapter" data-level="4.1" data-path="chapter-4.html"><a href="chapter-4.html#boxplots"><i class="fa fa-check"></i><b>4.1</b> Boxplots</a>
<ul>
<li class="chapter" data-level="4.1.1" data-path="chapter-4.html"><a href="chapter-4.html#grouped-boxplots"><i class="fa fa-check"></i><b>4.1.1</b> Grouped boxplots</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="chapter-4.html"><a href="chapter-4.html#violin-plots"><i class="fa fa-check"></i><b>4.2</b> Violin plots</a></li>
<li class="chapter" data-level="4.3" data-path="chapter-4.html"><a href="chapter-4.html#bar-chart-of-means"><i class="fa fa-check"></i><b>4.3</b> Bar chart of means</a></li>
<li class="chapter" data-level="4.4" data-path="chapter-4.html"><a href="chapter-4.html#violin-boxplot"><i class="fa fa-check"></i><b>4.4</b> Violin-boxplot</a>
<ul>
<li class="chapter" data-level="4.4.1" data-path="chapter-4.html"><a href="chapter-4.html#grouped-violin-boxplots"><i class="fa fa-check"></i><b>4.4.1</b> Grouped violin-boxplots</a></li>
</ul></li>
<li class="chapter" data-level="4.5" data-path="chapter-4.html"><a href="chapter-4.html#customisation-part-3"><i class="fa fa-check"></i><b>4.5</b> Customisation part 3</a></li>
<li class="chapter" data-level="4.6" data-path="chapter-4.html"><a href="chapter-4.html#activities-3"><i class="fa fa-check"></i><b>4.6</b> Activities 3</a></li>
</ul></li>
<li class="chapter" data-level="5" data-path="chapter-5.html"><a href="chapter-5.html"><i class="fa fa-check"></i><b>5</b> Chapter 5</a>
<ul>
<li class="chapter" data-level="5.1" data-path="chapter-5.html"><a href="chapter-5.html#interaction-plots"><i class="fa fa-check"></i><b>5.1</b> Interaction plots</a></li>
<li class="chapter" data-level="5.2" data-path="chapter-5.html"><a href="chapter-5.html#combined-interaction-plots"><i class="fa fa-check"></i><b>5.2</b> Combined interaction plots</a></li>
<li class="chapter" data-level="5.3" data-path="chapter-5.html"><a href="chapter-5.html#facets"><i class="fa fa-check"></i><b>5.3</b> Facets</a></li>
<li class="chapter" data-level="5.4" data-path="chapter-5.html"><a href="chapter-5.html#saving-plots"><i class="fa fa-check"></i><b>5.4</b> Saving plots</a></li>
<li class="chapter" data-level="5.5" data-path="chapter-5.html"><a href="chapter-5.html#exporting-plots"><i class="fa fa-check"></i><b>5.5</b> Exporting plots</a></li>
<li class="chapter" data-level="5.6" data-path="chapter-5.html"><a href="chapter-5.html#multiple-plots"><i class="fa fa-check"></i><b>5.6</b> Multiple plots</a>
<ul>
<li class="chapter" data-level="5.6.1" data-path="chapter-5.html"><a href="chapter-5.html#combining-two-plots"><i class="fa fa-check"></i><b>5.6.1</b> Combining two plots</a></li>
<li class="chapter" data-level="5.6.2" data-path="chapter-5.html"><a href="chapter-5.html#combining-three-or-more-plots"><i class="fa fa-check"></i><b>5.6.2</b> Combining three or more plots</a></li>
</ul></li>
<li class="chapter" data-level="5.7" data-path="chapter-5.html"><a href="chapter-5.html#customisation-part-4"><i class="fa fa-check"></i><b>5.7</b> Customisation part 4</a>
<ul>
<li class="chapter" data-level="5.7.1" data-path="chapter-5.html"><a href="chapter-5.html#axis-labels"><i class="fa fa-check"></i><b>5.7.1</b> Axis labels</a></li>
<li class="chapter" data-level="5.7.2" data-path="chapter-5.html"><a href="chapter-5.html#non-meaningful-colours"><i class="fa fa-check"></i><b>5.7.2</b> Non-meaningful colours</a></li>
</ul></li>
<li class="chapter" data-level="5.8" data-path="chapter-5.html"><a href="chapter-5.html#activities-4"><i class="fa fa-check"></i><b>5.8</b> Activities 4</a></li>
</ul></li>
<li class="chapter" data-level="6" data-path="chapter-6.html"><a href="chapter-6.html"><i class="fa fa-check"></i><b>6</b> Chapter 6</a>
<ul>
<li class="chapter" data-level="6.0.1" data-path="chapter-6.html"><a href="chapter-6.html#split-violin-plots"><i class="fa fa-check"></i><b>6.0.1</b> Split-violin plots</a></li>
<li class="chapter" data-level="6.0.2" data-path="chapter-6.html"><a href="chapter-6.html#raincloud-plots"><i class="fa fa-check"></i><b>6.0.2</b> Raincloud plots</a></li>
<li class="chapter" data-level="6.0.3" data-path="chapter-6.html"><a href="chapter-6.html#ridge-plots"><i class="fa fa-check"></i><b>6.0.3</b> Ridge plots</a></li>
<li class="chapter" data-level="6.0.4" data-path="chapter-6.html"><a href="chapter-6.html#alluvial-plots"><i class="fa fa-check"></i><b>6.0.4</b> Alluvial plots</a></li>
</ul></li>
<li class="appendix"><span><b>Appendices</b></span></li>
<li class="chapter" data-level="A" data-path="additional-resources.html"><a href="additional-resources.html"><i class="fa fa-check"></i><b>A</b> Additional resources</a></li>
<li class="chapter" data-level="B" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html"><i class="fa fa-check"></i><b>B</b> Additional advanced plots and customisation options</a>
<ul>
<li class="chapter" data-level="B.1" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#adding-lines-to-plots"><i class="fa fa-check"></i><b>B.1</b> Adding lines to plots</a></li>
<li class="chapter" data-level="B.2" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#zooming-in-and-out"><i class="fa fa-check"></i><b>B.2</b> Zooming in and out</a></li>
<li class="chapter" data-level="B.3" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#setting-the-axis-values"><i class="fa fa-check"></i><b>B.3</b> Setting the axis values</a></li>
<li class="chapter" data-level="B.4" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#controlling-the-legend"><i class="fa fa-check"></i><b>B.4</b> Controlling the Legend</a></li>
<li class="chapter" data-level="B.5" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#setting-a-lab-theme-using-theme"><i class="fa fa-check"></i><b>B.5</b> Setting A Lab Theme using <code>theme()</code></a></li>
<li class="chapter" data-level="B.6" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#easter-egg---overlaying-plots"><i class="fa fa-check"></i><b>B.6</b> Easter Egg - Overlaying Plots</a></li>
<li class="chapter" data-level="B.7" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#easter-egg---a-dumbbell-plot"><i class="fa fa-check"></i><b>B.7</b> Easter Egg - A Dumbbell Plot</a></li>
<li class="chapter" data-level="B.8" data-path="additional-advanced-plots-and-customisation-options.html"><a href="additional-advanced-plots-and-customisation-options.html#easter-egg---a-pie-chart"><i class="fa fa-check"></i><b>B.8</b> Easter Egg - A Pie Chart</a></li>
</ul></li>
<li class="divider"></li>
<li><a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/" 
    target="blank"><img alt="Creative Commons License" 
    style="border-width:0" 
    src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a></li>
<li><a href="https://psyteachr.github.io/books" target="blank">PsyTeachR Books</a></li>

</ul>

      </nav>
    </div>

    <div class="book-body">
      <div class="body-inner">
        <div class="book-header" role="navigation">
          <h1>
            <i class="fa fa-circle-o-notch fa-spin"></i><a href="./">Data visualisation using R, for researchers who don’t use R</a>
          </h1>
        </div>

        <div class="page-wrapper" tabindex="-1" role="main">
          <div class="page-inner">

            <section class="normal" id="section-">
<div id="chapter-5" class="section level1" number="5">
<h1><span class="header-section-number">Chapter 5</span> Chapter 5</h1>
<div id="interaction-plots" class="section level2" number="5.1">
<h2><span class="header-section-number">5.1</span> Interaction plots</h2>
<p>Interaction plots are commonly used to help display or interpret a factorial design. Just as with the bar chart of means, interaction plots represent data summaries and so they are built up with a series of calls to <code>stat_summary()</code>.</p>
<ul>
<li><p><code>shape</code> acts much like <code>fill</code> in previous plots, except that rather than producing different colour fills for each level of the IV, the data points are given different shapes.</p></li>
<li><p><code>size</code> lets you change the size of lines and points. You usually don’t want different groups to be different sizes, so this option is set inside the relevant <code>geom_*()</code> function, not inside the <code>aes()</code> function.</p></li>
<li><p><code>scale_color_manual()</code> works much like <code>scale_color_discrete()</code> except that it lets you specify the colour values manually, instead of then being automatically applied based on the palette you choose/default to. You can specify RGB colour values or a list of predefined colour names - all available options can be found by running <code>colours()</code> in the console. Other manual scales are also available, for example, <code>scale_fill_manual</code>.</p></li>
</ul>
<div class="sourceCode" id="cb58"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb58-1"><a href="chapter-5.html#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y =</span> rt, </span>
<span id="cb58-2"><a href="chapter-5.html#cb58-2" aria-hidden="true" tabindex="-1"></a>                     <span class="at">shape =</span> language,</span>
<span id="cb58-3"><a href="chapter-5.html#cb58-3" aria-hidden="true" tabindex="-1"></a>                     <span class="at">group =</span> language,</span>
<span id="cb58-4"><a href="chapter-5.html#cb58-4" aria-hidden="true" tabindex="-1"></a>                     <span class="at">color =</span> language)) <span class="sc">+</span></span>
<span id="cb58-5"><a href="chapter-5.html#cb58-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>, <span class="at">size =</span> <span class="dv">3</span>) <span class="sc">+</span></span>
<span id="cb58-6"><a href="chapter-5.html#cb58-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;line&quot;</span>) <span class="sc">+</span></span>
<span id="cb58-7"><a href="chapter-5.html#cb58-7" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb58-8"><a href="chapter-5.html#cb58-8" aria-hidden="true" tabindex="-1"></a>  <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">&quot;blue&quot;</span>, <span class="st">&quot;darkorange&quot;</span>)) <span class="sc">+</span></span>
<span id="cb58-9"><a href="chapter-5.html#cb58-9" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_classic</span>()</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:ixn-plot"></span>
<img src="05-ch5_files/figure-html/ixn-plot-1.png" alt="Interaction plot." width="100%" />
<p class="caption">
Figure 5.1: Interaction plot.
</p>
</div>
</div>
<div id="combined-interaction-plots" class="section level2" number="5.2">
<h2><span class="header-section-number">5.2</span> Combined interaction plots</h2>
<p>A more complex interaction plot can be produced that takes advantage of the layers to visualise not only the overall interaction, but the change across conditions for each participant.</p>
<p>This code is more complex than all prior code because it does not use a universal mapping of the plot aesthetics. In our code so far, the aesthetic mapping (<code>aes</code>) of the plot has been specified in the first line of code as all layers have used the same mapping, however, is is also possible for each layer to use a different mapping.</p>
<ul>
<li>The first call to <code>ggplot()</code> sets up the default mappings of the plot that will be used unless otherwise specified - the <code>x</code>, <code>y</code> and <code>group</code> variable. Note two additions are <code>shape</code> and <code>linetype</code> that will vary those elements according to the language variable.</li>
<li><code>geom_point()</code> overrides the default mapping by setting its own <code>colour</code> to draw the data points from each language group in a different colour. <code>alpha</code> is set to a low value to aid readability. Note that because the aesthetic override was defined within the geom function, the colours are not represented in the legend.</li>
<li>Similarly, <code>geom_line()</code> overrides the default grouping variable so that a line is drawn to connect the individual data points for each <em>participant</em> (<code>group = id</code>) rather than each language group, and also sets the colours. The default line type is also overridden and set for all lines to be solid.</li>
<li>Finally, the calls to <code>stat_summary()</code> remain largely as they were, with the exception of setting <code>colour = "black"</code> and <code>size = 2</code> so that the overall means and error bars can be more easily distinguished from the individual data points. Because they do not specify an individual mapping, they use the defaults (e.g., the lines are connected by language group). For the error bars the lines are again made solid.</li>
</ul>
<div class="sourceCode" id="cb59"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb59-1"><a href="chapter-5.html#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y =</span> rt, <span class="at">group =</span> language, <span class="at">shape =</span> language)) <span class="sc">+</span></span>
<span id="cb59-2"><a href="chapter-5.html#cb59-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_point</span>(<span class="fu">aes</span>(<span class="at">colour =</span> language),<span class="at">alpha =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb59-3"><a href="chapter-5.html#cb59-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_line</span>(<span class="fu">aes</span>(<span class="at">group =</span> id, <span class="at">colour =</span> language), <span class="at">alpha =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb59-4"><a href="chapter-5.html#cb59-4" aria-hidden="true" tabindex="-1"></a>   <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>, <span class="at">size =</span> <span class="dv">2</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb59-5"><a href="chapter-5.html#cb59-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;line&quot;</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb59-6"><a href="chapter-5.html#cb59-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">2</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb59-7"><a href="chapter-5.html#cb59-7" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>()</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-2"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-2-1.png" alt="Interaction plot with by-participant data" width="100%" />
<p class="caption">
Figure 5.2: Interaction plot with by-participant data
</p>
</div>
</div>
<div id="facets" class="section level2" number="5.3">
<h2><span class="header-section-number">5.3</span> Facets</h2>
<p>So far we have produced single plots that display all the desired variables in one, however, there are situations in which it may be useful to create separate plots for each level of a variable. The below code is an adaptation of the code used to produce the grouped scatterplot (see Figure  <a href="chapter-4.html#fig:viobox2">4.8</a>) in which it may be easier to see how the relationship changes when the data are not overlaid.</p>
<ul>
<li>Rather than using <code>colour = condition</code> to produce different colours for each level of <code>condition</code>, this variable is instead passed to <code>facet_wrap()</code>.</li>
</ul>
<div class="sourceCode" id="cb60"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb60-1"><a href="chapter-5.html#cb60-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> rt, <span class="at">y =</span> age)) <span class="sc">+</span></span>
<span id="cb60-2"><a href="chapter-5.html#cb60-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_point</span>() <span class="sc">+</span></span>
<span id="cb60-3"><a href="chapter-5.html#cb60-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_smooth</span>(<span class="at">method =</span> <span class="st">&quot;lm&quot;</span>) <span class="sc">+</span></span>
<span id="cb60-4"><a href="chapter-5.html#cb60-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>condition) <span class="sc">+</span></span>
<span id="cb60-5"><a href="chapter-5.html#cb60-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">scale_color_discrete</span>(<span class="at">name =</span> <span class="st">&quot;Condition&quot;</span>,</span>
<span id="cb60-6"><a href="chapter-5.html#cb60-6" aria-hidden="true" tabindex="-1"></a>                      <span class="at">labels =</span> <span class="fu">c</span>(<span class="st">&quot;Word&quot;</span>, <span class="st">&quot;Non-word&quot;</span>))</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-3"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-3-1.png" alt="Faceted scatterplot" width="100%" />
<p class="caption">
Figure 5.3: Faceted scatterplot
</p>
</div>
<p>As another example, we can use <code>facet_wrap()</code> as an alternative to the grouped violin-boxplot (see Figure X) in which the variable <code>language</code> is passed to <code>facet_wrap()</code> rather than <code>fill</code>.</p>
<div class="sourceCode" id="cb61"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb61-1"><a href="chapter-5.html#cb61-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y=</span> rt)) <span class="sc">+</span></span>
<span id="cb61-2"><a href="chapter-5.html#cb61-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_violin</span>() <span class="sc">+</span></span>
<span id="cb61-3"><a href="chapter-5.html#cb61-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_boxplot</span>(<span class="at">width =</span> .<span class="dv">2</span>, <span class="at">fatten =</span> <span class="cn">NULL</span>) <span class="sc">+</span></span>
<span id="cb61-4"><a href="chapter-5.html#cb61-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>) <span class="sc">+</span></span>
<span id="cb61-5"><a href="chapter-5.html#cb61-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">1</span>) <span class="sc">+</span></span>
<span id="cb61-6"><a href="chapter-5.html#cb61-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>language) <span class="sc">+</span></span>
<span id="cb61-7"><a href="chapter-5.html#cb61-7" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>()</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-4"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-4-1.png" alt="Facted violin-boxplot" width="100%" />
<p class="caption">
Figure 5.4: Facted violin-boxplot
</p>
</div>
<p>Finally, note that editing the labels for faceted variables uses the <code>labeller</code> function, calling it within <code>facet_wrap</code>. <code>labeller</code> uses syntax that is different from what we have shown you up to now. Syntax simply refers to the rules about the words that a function uses. In the exercise about looking for the underlying rules to the code from the previous chapter you likely tapped into the rules for the various <code>ggplot</code> functions. However, once in a while you will come across something that just does not follow the rules you have been building on and <code>labeller</code> is an example of that.</p>
<p>Before we explain it, read the below code and see if you can figure out the syntactic rules for the function.</p>
<div class="sourceCode" id="cb62"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb62-1"><a href="chapter-5.html#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y=</span> rt)) <span class="sc">+</span></span>
<span id="cb62-2"><a href="chapter-5.html#cb62-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_violin</span>() <span class="sc">+</span></span>
<span id="cb62-3"><a href="chapter-5.html#cb62-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_boxplot</span>(<span class="at">width =</span> .<span class="dv">2</span>, <span class="at">fatten =</span> <span class="cn">NULL</span>) <span class="sc">+</span></span>
<span id="cb62-4"><a href="chapter-5.html#cb62-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>) <span class="sc">+</span></span>
<span id="cb62-5"><a href="chapter-5.html#cb62-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">1</span>) <span class="sc">+</span></span>
<span id="cb62-6"><a href="chapter-5.html#cb62-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>language, </span>
<span id="cb62-7"><a href="chapter-5.html#cb62-7" aria-hidden="true" tabindex="-1"></a>             <span class="at">labeller =</span> <span class="fu">labeller</span>(</span>
<span id="cb62-8"><a href="chapter-5.html#cb62-8" aria-hidden="true" tabindex="-1"></a>               <span class="at">language =</span> <span class="fu">c</span>(<span class="at">monolingual =</span> <span class="st">&quot;Monolingual participants&quot;</span>,</span>
<span id="cb62-9"><a href="chapter-5.html#cb62-9" aria-hidden="true" tabindex="-1"></a>                             <span class="at">bilingual =</span> <span class="st">&quot;Bilingual participants&quot;</span>))) <span class="sc">+</span></span>
<span id="cb62-10"><a href="chapter-5.html#cb62-10" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>()</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-5"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-5-1.png" alt="Faceted violin-boxplot with updated labels" width="100%" />
<p class="caption">
Figure 5.5: Faceted violin-boxplot with updated labels
</p>
</div>
<p>Even though the <code>labeller</code> syntax is new, it is still fairly logical, for each level of the variable you want to facet by, you need to specify a label, so you call the variable by naming it: <code>labeller = labeller(language =</code> then you make a list of the levels (monolingual and bilingual) and for each you tell the function its new name <code>c(monolingual = "Monolingual participants", bilingual = "Bilingual participants")</code>.</p>
</div>
<div id="saving-plots" class="section level2" number="5.4">
<h2><span class="header-section-number">5.4</span> Saving plots</h2>
<p>Just like with datasets, plots can be saved to objects. The below code saves the histograms we produced for reaction time and accuracy to objects named <code>p1</code> and <code>p2</code>. These plots can then be viewed by calling the object name in the console.</p>
<div class="sourceCode" id="cb63"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb63-1"><a href="chapter-5.html#cb63-1" aria-hidden="true" tabindex="-1"></a>p1 <span class="ot">&lt;-</span> <span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> rt)) <span class="sc">+</span></span>
<span id="cb63-2"><a href="chapter-5.html#cb63-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_histogram</span>(<span class="at">binwidth =</span> <span class="dv">10</span>, <span class="at">color =</span> <span class="st">&quot;black&quot;</span>)</span>
<span id="cb63-3"><a href="chapter-5.html#cb63-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb63-4"><a href="chapter-5.html#cb63-4" aria-hidden="true" tabindex="-1"></a>p2 <span class="ot">&lt;-</span> <span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> acc)) <span class="sc">+</span></span>
<span id="cb63-5"><a href="chapter-5.html#cb63-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_histogram</span>(<span class="at">binwidth =</span> <span class="dv">1</span>, <span class="at">color =</span> <span class="st">&quot;black&quot;</span>) </span></code></pre></div>
<p>Importantly, layers can then be added to these saved objects. For example, the below code adds a theme to the plot saved in <code>p1</code> and saves it as a new object <code>p3</code>. This is important because many of the examples of <code>ggplot</code> code you will find in online help forums use the <code>p +</code> format to build up plots but fail to explain what this means, which can be confusing to beginners.</p>
<div class="sourceCode" id="cb64"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb64-1"><a href="chapter-5.html#cb64-1" aria-hidden="true" tabindex="-1"></a>p3 <span class="ot">&lt;-</span> p1 <span class="sc">+</span> <span class="fu">theme_minimal</span>()</span></code></pre></div>
</div>
<div id="exporting-plots" class="section level2" number="5.5">
<h2><span class="header-section-number">5.5</span> Exporting plots</h2>
<p>In addition to saving plots to objects for further use in R, the function <code>ggsave()</code> can be used to save plots to your hard drive. The only required argument for <code>ggsave</code> is the file name of the image file you will create, complete with file extension (this can be “eps,” “ps,” “tex,” “pdf,” “jpeg,” “tiff,” “png,” “bmp,” “svg” or “wmf”). By default, <code>ggsave()</code> will save the last plot displayed, however, you can also specify a specific plot object.</p>
<div class="sourceCode" id="cb65"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb65-1"><a href="chapter-5.html#cb65-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggsave</span>(<span class="at">filename =</span> <span class="st">&quot;my_plot.png&quot;</span>) <span class="co"># save last displayed plot</span></span>
<span id="cb65-2"><a href="chapter-5.html#cb65-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ggsave</span>(<span class="at">filename =</span> <span class="st">&quot;my_plot.png&quot;</span>, <span class="at">plot =</span> p3) <span class="co"># save plot p3</span></span></code></pre></div>
<p>The width, height and resolution of the image can all be manually adjusted and the help documentation for is useful here (type <code>?ggsave</code> in the console to access the help).</p>
</div>
<div id="multiple-plots" class="section level2" number="5.6">
<h2><span class="header-section-number">5.6</span> Multiple plots</h2>
<p>As well as creating separate plots for each level of a variable using <code>facet_wrap()</code>, you may also wish to display multiple different plots together and the <code>patchwork</code> package provides an intuitive way to do this. <code>patchwork</code> does not require the use of any functions once it is loaded with <code>library(patchwork)</code>, you simply need to save the plots you wish to combine to objects as above and use the operators <code>+</code>, <code>/</code> <code>()</code> and <code>|</code> to specify the look of the final figure.</p>
<div id="combining-two-plots" class="section level3" number="5.6.1">
<h3><span class="header-section-number">5.6.1</span> Combining two plots</h3>
<p>Two plots can be combined side-by-side or stacked on top of each other. These combined plots could also be saved to an object and then passed to <code>ggsave</code>.</p>
<div class="sourceCode" id="cb66"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb66-1"><a href="chapter-5.html#cb66-1" aria-hidden="true" tabindex="-1"></a>p1 <span class="sc">+</span> p2 <span class="co"># side-by-side</span></span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-9"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-9-1.png" alt="Side-by-side plots with patchwork" width="100%" />
<p class="caption">
Figure 5.6: Side-by-side plots with patchwork
</p>
</div>
<div class="sourceCode" id="cb67"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb67-1"><a href="chapter-5.html#cb67-1" aria-hidden="true" tabindex="-1"></a>p1 <span class="sc">/</span> p2 <span class="co"># stacked</span></span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-10"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-10-1.png" alt="Stacked plots with patchwork" width="100%" />
<p class="caption">
Figure 5.7: Stacked plots with patchwork
</p>
</div>
</div>
<div id="combining-three-or-more-plots" class="section level3" number="5.6.2">
<h3><span class="header-section-number">5.6.2</span> Combining three or more plots</h3>
<p>Three or more plots can be combined in a number of ways and the <code>patchwork</code> syntax is relatively easy to grasp with a few examples and a bit of trial and error. First, we save the complex interaction plot and faceted violin-boxplot to objects named <code>p5</code> and <code>p6</code>.</p>
<div class="sourceCode" id="cb68"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb68-1"><a href="chapter-5.html#cb68-1" aria-hidden="true" tabindex="-1"></a>p5 <span class="ot">&lt;-</span> <span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y =</span> rt, <span class="at">group =</span> language, <span class="at">shape =</span> language)) <span class="sc">+</span></span>
<span id="cb68-2"><a href="chapter-5.html#cb68-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_point</span>(<span class="fu">aes</span>(<span class="at">colour =</span> language),<span class="at">alpha =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb68-3"><a href="chapter-5.html#cb68-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_line</span>(<span class="fu">aes</span>(<span class="at">group =</span> id, <span class="at">colour =</span> language), <span class="at">alpha =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb68-4"><a href="chapter-5.html#cb68-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>, <span class="at">size =</span> <span class="dv">2</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb68-5"><a href="chapter-5.html#cb68-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;line&quot;</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb68-6"><a href="chapter-5.html#cb68-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">2</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb68-7"><a href="chapter-5.html#cb68-7" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>()</span>
<span id="cb68-8"><a href="chapter-5.html#cb68-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb68-9"><a href="chapter-5.html#cb68-9" aria-hidden="true" tabindex="-1"></a>p6 <span class="ot">&lt;-</span> <span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y=</span> rt)) <span class="sc">+</span></span>
<span id="cb68-10"><a href="chapter-5.html#cb68-10" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_violin</span>() <span class="sc">+</span></span>
<span id="cb68-11"><a href="chapter-5.html#cb68-11" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_boxplot</span>(<span class="at">width =</span> .<span class="dv">2</span>, <span class="at">fatten =</span> <span class="cn">NULL</span>) <span class="sc">+</span></span>
<span id="cb68-12"><a href="chapter-5.html#cb68-12" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>) <span class="sc">+</span></span>
<span id="cb68-13"><a href="chapter-5.html#cb68-13" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">1</span>) <span class="sc">+</span></span>
<span id="cb68-14"><a href="chapter-5.html#cb68-14" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>language, </span>
<span id="cb68-15"><a href="chapter-5.html#cb68-15" aria-hidden="true" tabindex="-1"></a>             <span class="at">labeller =</span> <span class="fu">labeller</span>(</span>
<span id="cb68-16"><a href="chapter-5.html#cb68-16" aria-hidden="true" tabindex="-1"></a>               <span class="at">language =</span> (<span class="fu">c</span>(<span class="at">monolingual =</span> <span class="st">&quot;Monolingual participants&quot;</span>, </span>
<span id="cb68-17"><a href="chapter-5.html#cb68-17" aria-hidden="true" tabindex="-1"></a>                             <span class="at">bilingual =</span> <span class="st">&quot;Bilingual participants&quot;</span>)))) <span class="sc">+</span></span>
<span id="cb68-18"><a href="chapter-5.html#cb68-18" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>()</span></code></pre></div>
<p>The exact layout of your plots will depend upon a number of factors. Try running the below examples and adjust the use of the operators to see how they change the layout. Each line of code will draw a different figure.</p>
<div class="sourceCode" id="cb69"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb69-1"><a href="chapter-5.html#cb69-1" aria-hidden="true" tabindex="-1"></a>p1 <span class="sc">/</span>p5 <span class="sc">/</span> p6 </span>
<span id="cb69-2"><a href="chapter-5.html#cb69-2" aria-hidden="true" tabindex="-1"></a>(p1 <span class="sc">+</span> p6) <span class="sc">/</span> p5 </span>
<span id="cb69-3"><a href="chapter-5.html#cb69-3" aria-hidden="true" tabindex="-1"></a>p6 <span class="sc">|</span> p1 <span class="sc">/</span> p5 </span></code></pre></div>
</div>
</div>
<div id="customisation-part-4" class="section level2" number="5.7">
<h2><span class="header-section-number">5.7</span> Customisation part 4</h2>
<div id="axis-labels" class="section level3" number="5.7.1">
<h3><span class="header-section-number">5.7.1</span> Axis labels</h3>
<p>Previously when we edited the main axis labels we used the <code>scale_</code> functions to do so. These functions are useful to know because they allow you to customise each aspect of the scale, for example, the breaks and limits. However, if you only need to change the main axis <code>name</code>, there is a quicker way to do so using <code>labs()</code>. The below code adds a layer to the plot that changes the axis labels for the histogram saved in <code>p1</code> and adds a title and subtitle. The title and subtitle do not conform to APA standards (more on APA formatting in the additional resources), however, for presentations and social media they can be useful.</p>
<div class="sourceCode" id="cb70"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb70-1"><a href="chapter-5.html#cb70-1" aria-hidden="true" tabindex="-1"></a>p5 <span class="sc">+</span> <span class="fu">labs</span>(<span class="at">x =</span> <span class="st">&quot;Type of word&quot;</span>,</span>
<span id="cb70-2"><a href="chapter-5.html#cb70-2" aria-hidden="true" tabindex="-1"></a>          <span class="at">y =</span> <span class="st">&quot;Reaction time (ms)&quot;</span>,</span>
<span id="cb70-3"><a href="chapter-5.html#cb70-3" aria-hidden="true" tabindex="-1"></a>          <span class="at">title =</span> <span class="st">&quot;Language group by word type interaction plot&quot;</span>,</span>
<span id="cb70-4"><a href="chapter-5.html#cb70-4" aria-hidden="true" tabindex="-1"></a>          <span class="at">subtitle =</span> <span class="st">&quot;Reaction time data&quot;</span>)</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:fig"></span>
<img src="05-ch5_files/figure-html/fig-1.png" alt="TRUE" width="100%" />
<p class="caption">
Figure 5.8: TRUE
</p>
</div>
<p>You can also use <code>labs()</code> to remove axis labels, for example, try adjusting the above code to <code>x = NULL</code>.</p>
</div>
<div id="non-meaningful-colours" class="section level3" number="5.7.2">
<h3><span class="header-section-number">5.7.2</span> Non-meaningful colours</h3>
<p>So far when we have produced plots with colours, the colours were meaningful in that they represented different levels of a variable, but it is also possible to include colour for purely aesthetic reasons.</p>
<p>The below code adds <code>fill = language</code> to the faceted violin-boxplots, in addition to adjusting <code>alpha</code> and using the viridis colour palette.</p>
<div class="sourceCode" id="cb71"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb71-1"><a href="chapter-5.html#cb71-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y=</span> rt, <span class="at">fill =</span> language)) <span class="sc">+</span></span>
<span id="cb71-2"><a href="chapter-5.html#cb71-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_violin</span>(<span class="at">alpha =</span> .<span class="dv">4</span>) <span class="sc">+</span></span>
<span id="cb71-3"><a href="chapter-5.html#cb71-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_boxplot</span>(<span class="at">width =</span> .<span class="dv">2</span>, <span class="at">fatten =</span> <span class="cn">NULL</span>, <span class="at">alpha =</span> .<span class="dv">6</span>) <span class="sc">+</span></span>
<span id="cb71-4"><a href="chapter-5.html#cb71-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>) <span class="sc">+</span></span>
<span id="cb71-5"><a href="chapter-5.html#cb71-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">1</span>) <span class="sc">+</span></span>
<span id="cb71-6"><a href="chapter-5.html#cb71-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>language, </span>
<span id="cb71-7"><a href="chapter-5.html#cb71-7" aria-hidden="true" tabindex="-1"></a>             <span class="at">labeller =</span> <span class="fu">labeller</span>(</span>
<span id="cb71-8"><a href="chapter-5.html#cb71-8" aria-hidden="true" tabindex="-1"></a>               <span class="at">language =</span> (<span class="fu">c</span>(<span class="at">monolingual =</span> <span class="st">&quot;Monolingual participants&quot;</span>, </span>
<span id="cb71-9"><a href="chapter-5.html#cb71-9" aria-hidden="true" tabindex="-1"></a>                             <span class="at">bilingual =</span> <span class="st">&quot;Bilingual participants&quot;</span>)))) <span class="sc">+</span></span>
<span id="cb71-10"><a href="chapter-5.html#cb71-10" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>() <span class="sc">+</span></span>
<span id="cb71-11"><a href="chapter-5.html#cb71-11" aria-hidden="true" tabindex="-1"></a>  <span class="fu">scale_fill_viridis_d</span>(<span class="at">option =</span> <span class="st">&quot;E&quot;</span>)</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-13"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-13-1.png" alt="Violin-boxplot with redundant legend" width="100%" />
<p class="caption">
Figure 5.9: Violin-boxplot with redundant legend
</p>
</div>
<p>Specifying a <code>fill</code> variable means that by default, R has produced a legend for that variable. However, given that the use of colour is not meaningful, this is a waste of plot space (it provides no more information than what is represented already by the x-axis). You can remove this legend with the <code>guides</code> function.</p>
<div class="sourceCode" id="cb72"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb72-1"><a href="chapter-5.html#cb72-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y=</span> rt, <span class="at">fill =</span> language)) <span class="sc">+</span></span>
<span id="cb72-2"><a href="chapter-5.html#cb72-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_violin</span>(<span class="at">alpha =</span> .<span class="dv">4</span>) <span class="sc">+</span></span>
<span id="cb72-3"><a href="chapter-5.html#cb72-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_boxplot</span>(<span class="at">width =</span> .<span class="dv">2</span>, <span class="at">fatten =</span> <span class="cn">NULL</span>, <span class="at">alpha =</span> .<span class="dv">6</span>) <span class="sc">+</span></span>
<span id="cb72-4"><a href="chapter-5.html#cb72-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>) <span class="sc">+</span></span>
<span id="cb72-5"><a href="chapter-5.html#cb72-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">1</span>) <span class="sc">+</span></span>
<span id="cb72-6"><a href="chapter-5.html#cb72-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>language, </span>
<span id="cb72-7"><a href="chapter-5.html#cb72-7" aria-hidden="true" tabindex="-1"></a>             <span class="at">labeller =</span> <span class="fu">labeller</span>(<span class="at">language =</span> (<span class="fu">c</span>(<span class="at">monolingual =</span> <span class="st">&quot;Monolingual participants&quot;</span>, <span class="at">bilingual =</span> <span class="st">&quot;Bilingual participants&quot;</span>)))) <span class="sc">+</span></span>
<span id="cb72-8"><a href="chapter-5.html#cb72-8" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>() <span class="sc">+</span></span>
<span id="cb72-9"><a href="chapter-5.html#cb72-9" aria-hidden="true" tabindex="-1"></a>  <span class="fu">scale_fill_viridis_d</span>(<span class="at">option =</span> <span class="st">&quot;E&quot;</span>) <span class="sc">+</span></span>
<span id="cb72-10"><a href="chapter-5.html#cb72-10" aria-hidden="true" tabindex="-1"></a>  <span class="fu">guides</span>(<span class="at">fill =</span> <span class="cn">FALSE</span>)</span></code></pre></div>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-14"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-14-1.png" alt="Plot with suppressed redundant legend" width="100%" />
<p class="caption">
Figure 5.10: Plot with suppressed redundant legend
</p>
</div>
</div>
</div>
<div id="activities-4" class="section level2" number="5.8">
<h2><span class="header-section-number">5.8</span> Activities 4</h2>
<p>Before you go on, do the following:</p>
<ol style="list-style-type: decimal">
<li>Rather than mapping both variables (<code>condition</code> and <code>language)</code> to a single interaction plot with individual participant data, instead produce a faceted plot that separates the monolingual and bilingual data. All visual elements should remain the same (colours and shapes) and you should also take care not to have any redundant legends.</li>
</ol>
<div class="webex-solution">
<button>
Solution
</button>
<div class="sourceCode" id="cb73"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb73-1"><a href="chapter-5.html#cb73-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat_long, <span class="fu">aes</span>(<span class="at">x =</span> condition, <span class="at">y =</span> rt, <span class="at">group =</span> language, <span class="at">shape =</span> language)) <span class="sc">+</span></span>
<span id="cb73-2"><a href="chapter-5.html#cb73-2" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_point</span>(<span class="fu">aes</span>(<span class="at">colour =</span> language),<span class="at">alpha =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb73-3"><a href="chapter-5.html#cb73-3" aria-hidden="true" tabindex="-1"></a>  <span class="fu">geom_line</span>(<span class="fu">aes</span>(<span class="at">group =</span> id, <span class="at">colour =</span> language), <span class="at">alpha =</span> .<span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb73-4"><a href="chapter-5.html#cb73-4" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;point&quot;</span>, <span class="at">size =</span> <span class="dv">2</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb73-5"><a href="chapter-5.html#cb73-5" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun =</span> <span class="st">&quot;mean&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;line&quot;</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb73-6"><a href="chapter-5.html#cb73-6" aria-hidden="true" tabindex="-1"></a>  <span class="fu">stat_summary</span>(<span class="at">fun.data =</span> <span class="st">&quot;mean_se&quot;</span>, <span class="at">geom =</span> <span class="st">&quot;errorbar&quot;</span>, <span class="at">width =</span> .<span class="dv">2</span>, <span class="at">colour =</span> <span class="st">&quot;black&quot;</span>) <span class="sc">+</span></span>
<span id="cb73-7"><a href="chapter-5.html#cb73-7" aria-hidden="true" tabindex="-1"></a>  <span class="fu">theme_minimal</span>() <span class="sc">+</span></span>
<span id="cb73-8"><a href="chapter-5.html#cb73-8" aria-hidden="true" tabindex="-1"></a>  <span class="fu">facet_wrap</span>(<span class="sc">~</span>language) <span class="sc">+</span></span>
<span id="cb73-9"><a href="chapter-5.html#cb73-9" aria-hidden="true" tabindex="-1"></a>  <span class="fu">guides</span>(<span class="at">shape =</span> <span class="cn">FALSE</span>, <span class="at">colour =</span> <span class="cn">FALSE</span>) </span></code></pre></div>
<pre><code>## Warning: `guides(&lt;scale&gt; = FALSE)` is deprecated. Please use `guides(&lt;scale&gt; =
## &quot;none&quot;)` instead.</code></pre>
<div class="figure" style="text-align: center"><span id="fig:unnamed-chunk-15"></span>
<img src="05-ch5_files/figure-html/unnamed-chunk-15-1.png" alt="TRUE" width="100%" />
<p class="caption">
Figure 5.11: TRUE
</p>
</div>
<div class="sourceCode" id="cb75"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb75-1"><a href="chapter-5.html#cb75-1" aria-hidden="true" tabindex="-1"></a><span class="co"># this wasn&#39;t easy so if you got it, well done!</span></span></code></pre></div>
</div>
<ol start="2" style="list-style-type: decimal">
<li>Choose your favourite three plots you’ve produced so far in this tutorial, tidy them up with axis labels, your preferred colour scheme, and any necessary titles, and then combine them using <code>patchwork</code>. If you’re feeling particularly proud of them, post them on Twitter using #PsyTeachR.</li>
</ol>

</div>
</div>
<div class="psyteachr_footer">
  
</div>
<script>

/* update total correct if #webex-total_correct exists */
update_total_correct = function() {
  if (t = document.getElementById("webex-total_correct")) {
    t.innerHTML =
      document.getElementsByClassName("webex-correct").length + " of " +
      document.getElementsByClassName("webex-solveme").length + " correct";
  }
}

/* webex-solution button toggling function */
b_func = function() {
  var cl = this.parentElement.classList;
  if (cl.contains('open')) {
    cl.remove("open");
  } else {
    cl.add("open");
  }
}

/* function for checking solveme answers */
solveme_func = function(e) {
  var real_answers = JSON.parse(this.dataset.answer);
  var my_answer = this.value;
  var cl = this.classList;
  if (cl.contains("ignorecase")) {
    my_answer = my_answer.toLowerCase();
  }
  if (cl.contains("nospaces")) {
    my_answer = my_answer.replace(/ /g, "")
  }
  
  if (my_answer !== "" & real_answers.includes(my_answer)) {
    cl.add("webex-correct");
  } else {
    cl.remove("webex-correct");
  }

  // match numeric answers within a specified tolerance
  if(this.dataset.tol > 0){
    var tol = JSON.parse(this.dataset.tol);  
    var matches = real_answers.map(x => Math.abs(x - my_answer) < tol)
    if (matches.reduce((a, b) => a + b, 0) > 0) {
      cl.add("webex-correct");
    } else {
      cl.remove("webex-correct");
    }  
  }

  // added regex bit
  if (cl.contains("regex")){
    answer_regex = RegExp(real_answers.join("|"))
    if (answer_regex.test(my_answer)) {
      cl.add("webex-correct");
    }  
  }
  
  update_total_correct();
}

window.onload = function() {
  /* set up solution buttons */
  var buttons = document.getElementsByTagName("button");

  for (var i = 0; i < buttons.length; i++) {
    if (buttons[i].parentElement.classList.contains('webex-solution')) {
      buttons[i].onclick = b_func;
    }
  }
  
  /* set up webex-solveme inputs */
  var solveme = document.getElementsByClassName("webex-solveme");

  for (var i = 0; i < solveme.length; i++) {
    /* make sure input boxes don't auto-anything */
    solveme[i].setAttribute("autocomplete","off");
    solveme[i].setAttribute("autocorrect", "off");
    solveme[i].setAttribute("autocapitalize", "off"); 
    solveme[i].setAttribute("spellcheck", "false");
    solveme[i].value = "";
    
    /* adjust answer for ignorecase or nospaces */
    var cl = solveme[i].classList;
    var real_answer = solveme[i].dataset.answer;
    if (cl.contains("ignorecase")) {
      real_answer = real_answer.toLowerCase();
    }
    if (cl.contains("nospaces")) {
      real_answer = real_answer.replace(/ /g, "");
    }
    solveme[i].dataset.answer = real_answer;
    
    /* attach checking function */
    solveme[i].onkeyup = solveme_func;
    solveme[i].onchange = solveme_func;
  }
  
  update_total_correct();
}

</script>
            </section>

          </div>
        </div>
      </div>
<a href="chapter-4.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="chapter-6.html" class="navigation navigation-next " aria-label="Next page"><i class="fa fa-angle-right"></i></a>
    </div>
  </div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/lunr.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"whatsapp": false,
"all": ["facebook", "google", "twitter", "linkedin", "weibo", "instapaper"],
"google": false
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": null,
"text": null
},
"history": {
"link": null,
"text": null
},
"view": {
"link": null,
"text": null
},
"download": {},
"toc": {
"collapse": "section",
"scroll_highlight": true
}
});
});
</script>

</body>

</html>
